home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000139_icon-group-sender_Thu Nov 2 08:03:02 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2F1bo08597
for icon-group-addresses; Thu, 2 Nov 2000 08:01:37 -0700 (MST)
Message-Id: <200011021501.eA2F1bo08597@baskerville.CS.Arizona.EDU>
Date: Thu, 02 Nov 2000 05:52:01 -0600
From: gep2@terabites.com
Subject: How would the experts handle this...??
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1637
> I wish to scan thru a file and determine how letters "connect" with one
another.
Turns out that in fact this is a VERY interesting issue... character adjacency
is a key to a great many very interesting algorithms.
> By that I mean that for every letter of the alphabet, I would
like to compile two lists: one containing all the letters which apper
to the right of the given letter, and another for all those appearing
to the left.
> Exmaple:
For the line....
> "Cable television programming is...."
> The output would might look something like:
> A: left- Cr
> right- bm
> B: left- a
> right- l
One issue is immediately apparent here (to me)... and that is that in the one
case, it seems you're ignoring case issues (the A) and respecting them (the C).
Is that intentional? You need to decide which it's going to be, and be
consistent each time.
> Thus far, I have been roundly criticized by icon afficiandos for my use
of explicit indexing. It seems to me an intuitive way to handle the
problems I've faced and makes the program "readable" to the layman.
I would join the list of those who are criticizing. :-) The whole point of
Icon is to eliminate this kind of error-prone "knit-one-purl-two" style of
C-type or BASIC-type programming.
Obviously, though, the solution ought to be a lot shorter and a lot higher level
when coded for Icon. :-)
Gordon Peterson
http://personal.terabites.com/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/
12/19/98: the day the Conservatives demonstrated their scorn for their
fraudulent sham of representative government. Voters, remember it!